﻿<%@ Register TagPrefix="uc1" TagName="menu_nhap" Src="../common/menu_nhap.ascx" %>
<%@ Register TagPrefix="uc1" TagName="menu_khachhang" Src="../common/menu_khachhang.ascx" %>
<%@ Register TagPrefix="uc1" TagName="menu_sales" Src="../common/menu_sales.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="order.aspx.vb" Inherits="kdadmin.order" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.01 Transitional//EN">
<HTML>
	<HEAD>
		<title>donhang</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="VBScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">		
	</HEAD>
	<body leftMargin="0" topMargin="0" MS_POSITIONING="FlowLayout">
		<form id="Form1" method="post" runat="server">
			<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0">
				<TR>
					<TD width="1%">&nbsp;</TD>
					<TD><uc1:menu_sales id="Menu_sales1" runat="server"></uc1:menu_sales></TD>
					<TD width="1%">&nbsp;</TD>
				</TR>
				<TR>
					<TD style="HEIGHT: 49px" width="1%"></TD>
					<TD style="HEIGHT: 49px"><asp:label id="lblWeek" runat="server"></asp:label><asp:label id="lblDoanhthu" runat="server"></asp:label></TD>
					<TD style="HEIGHT: 49px" width="1%"></TD>
				</TR>
				<TR>
					<TD style="HEIGHT: 28px" width="1%"></TD>
					<TD style="HEIGHT: 28px"><asp:label id="Label2" runat="server">Label2</asp:label></TD>
					<TD style="HEIGHT: 28px" width="1%"></TD>
				</TR>
				<TR>
					<TD style="HEIGHT: 584px"></TD>
					<TD style="HEIGHT: 584px"><asp:datagrid id="DataGrid1" runat="server" SelectedItemStyle-VerticalAlign="Top" PagerStyle-VerticalAlign="top"
							ItemStyle-VerticalAlign="Top" HeaderStyle-VerticalAlign="Top" FooterStyle-VerticalAlign="top" EditItemStyle-VerticalAlign="top"
							AlternatingItemStyle-VerticalAlign="top" OnPageIndexChanged="DataGrid1_PageIndexChanged" AutoGenerateColumns="False"
							BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" BackColor="White" ForeColor="Black" CellPadding="4" GridLines="Vertical">
							<FooterStyle VerticalAlign="Top" BackColor="#CCCC99"></FooterStyle>
							<SelectedItemStyle Font-Bold="True" ForeColor="White" VerticalAlign="Top" BackColor="#CE5D5A"></SelectedItemStyle>
							<EditItemStyle VerticalAlign="Top"></EditItemStyle>
							<AlternatingItemStyle VerticalAlign="Top" BackColor="White"></AlternatingItemStyle>
							<ItemStyle VerticalAlign="Top" BackColor="AliceBlue"></ItemStyle>
							<HeaderStyle Font-Bold="True" HorizontalAlign="Center" ForeColor="White" VerticalAlign="Top"
								BackColor="#6B696B"></HeaderStyle>
							<Columns>
								<asp:BoundColumn Visible="False" DataField="iddonhang" ReadOnly="True" HeaderText="IDdonhang"></asp:BoundColumn>
								<asp:TemplateColumn HeaderText="Kh&#225;ch h&#224;ng">
									<ItemStyle Width="40%"></ItemStyle>
									<ItemTemplate>
										<b><font color="#000066">
												<%# UCase(DataBinder.Eval(Container.DataItem, "hoten")) %>
											</font></b>
										<br>
										<b><font color="#000066">ÐT:</font></b><%# DataBinder.Eval(Container.DataItem, "dienthoai")%><br>
										<b><font color="#000066">Email:</font></b><%# DataBinder.Eval(Container.DataItem, "email")%><br>
										<b><font color="#000066">ÐC:</font></b><%# DataBinder.Eval(Container.DataItem, "diachi") & "-" & DataBinder.Eval(Container.DataItem, "thanhpho") & "-" & DataBinder.Eval(Container.DataItem, "quocgia")%>
										<br>
										<font color="#000066">Ngày đặt:</font>
										<%# DataBinder.Eval(Container.DataItem, "ngay") %>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="Chi tiết đơn h&#224;ng">
									<HeaderStyle VerticalAlign="Top"></HeaderStyle>
									<ItemStyle Width="55%"></ItemStyle>
									<ItemTemplate>
										<asp:DataGrid BorderStyle=None AlternatingItemStyle-VerticalAlign=Top ShowHeader=False Width=100% ID="dgct" Runat="server" DataSource ='<%# getDetailOrderSource(Databinder.eval(Container.DataItem,"iddonhang"))%>' AutoGenerateColumns ="False" BackColor="White" >
											<ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle>
											<Columns>
												<asp:TemplateColumn>
													<ItemTemplate>
														<asp:label ID="lblTen" runat="server" Text ='<%# iif(DataBinder.Eval(Container.DataItem, "dvt")="AU$",DataBinder.Eval(Container.DataItem, "tensanphamE"), iif(DataBinder.Eval(Container.DataItem, "dvt")="EUR",DataBinder.Eval(Container.DataItem, "tensanphamG"), iif(DataBinder.Eval(Container.DataItem, "dvt")="RMB",DataBinder.Eval(Container.DataItem, "tensanphamS"),DataBinder.Eval(Container.DataItem, "tensanpham"))))  %>' />
													</ItemTemplate>
												</asp:TemplateColumn>
												<asp:BoundColumn DataField="soluong"></asp:BoundColumn>
												<asp:BoundColumn DataField="gia" DataFormatString="{0:#,###}"></asp:BoundColumn>
												<asp:BoundColumn DataField="thanhtien" DataFormatString="{0:#,###}"></asp:BoundColumn>
											</Columns>
										</asp:DataGrid>
										<asp:Label ID="Label1" Text='<%# "<div align=""right"">Tổng cộng: <b>" & formatnumber(DataBinder.Eval(Container.DataItem, "tongtien").toString(),0) & " </b>Giảm:<b> " & formatnumber(DataBinder.Eval(Container.DataItem, "giam").toString(),0) & " </b>Còn lại:<b> " & formatnumber( DataBinder.Eval(Container.DataItem, "conlai").toString(),0) & "</b></div>" %>' Runat=server />
										<asp:Label ID="Label4" Text='<%# "<br>Ghi chú:" + DataBinder.Eval(Container.DataItem, "yeucau").toString() + "" %>' Runat=server />
									</ItemTemplate>
									<FooterStyle VerticalAlign="Top"></FooterStyle>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="Trạng th&#225;i">
									<ItemStyle Width="5%"></ItemStyle>
									<ItemTemplate>
										<asp:Label ID="Label5" Text='<%# DataBinder.Eval(Container.DataItem, "ttlienhe").toString() + "<br>DT:" +  formatnumber( DataBinder.Eval(Container.DataItem, "doanhthu"),0)  %>' Runat=server />
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="In">
									<ItemStyle Width="5%"></ItemStyle>
									<ItemTemplate>
										<asp:Label ID="chitiet" Text='<%# "<a href=""../backoffice/ctdonhang.aspx?id=" + DataBinder.Eval(Container.DataItem, "iddonhang").toString() + """>In </a><br><a href=""../backoffice/update.aspx?id=" + DataBinder.Eval(Container.DataItem, "iddonhang").toString() + """>Cập nhật </a>" %>' Runat=server />
									</ItemTemplate>
								</asp:TemplateColumn>
							</Columns>
							<PagerStyle VerticalAlign="Top" HorizontalAlign="Right" ForeColor="Black" BackColor="#F7F7DE"
								Mode="NumericPages"></PagerStyle>
						</asp:datagrid></TD>
					<TD width="1%" style="HEIGHT: 584px"></TD>
				</TR>
				<TR>
					<TD style="HEIGHT: 28px" width="1%"></TD>
					<TD style="HEIGHT: 28px"><asp:label id="Label3" runat="server"></asp:label></TD>
					<TD style="HEIGHT: 28px" width="1%"></TD>
				</TR>
				<TR>
					<TD style="WIDTH: 34px"></TD>
					<TD style="WIDTH: 992px"></TD>
					<TD></TD>
				</TR>
			</TABLE>
		</form>
	</body>
</HTML>
